<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=500, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p id="demo">
        javascript被改变内容
    </p>
    <script>
        function my(){
        //    x=document.getElementById("demo");
        //    x.innerHTML="HELLO";
        document.close();
        document.write("<p>这是一个段落</p><button type='button' onclick='my()'>点我</button>");
        }
      
    </script>
    <button type="button" onclick="my()">点我</button>












    
</body>
</html>